<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title></title>
</head>
	<script src="/dayscheduler/resources/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" href="/dayscheduler/resources/dhtmlxscheduler.css" type="text/css" title="no title" charset="utf-8">
	
	<script src="/dayscheduler/resources/ext/dhtmlxscheduler_readonly.js" type="text/javascript" charset="utf-8"></script>
	<script src="/dayscheduler/resources/ext/dhtmlxscheduler_minical.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" href="/dayscheduler/resources/ext/dhtmlxscheduler_ext.css" type="text/css" media="screen" title="no title" charset="utf-8">
	

	
<style type="text/css" media="screen">
	html, body{
		margin:0px;
		padding:0px;
		height:100%;
		overflow:hidden;
	}	
</style>

<script type="text/javascript" charset="utf-8">
	

	function init() {
		
		scheduler.config.default_date="%Y年%F%d日";
		scheduler.config.month_date="%Y年%F";

		scheduler.config.xml_date="%Y-%m-%d %H:%i";
		scheduler.config.prevent_cache = true;
		
		/*
		scheduler.config.lightbox.sections=[	
			{name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
			{name:"location", height:43, type:"textarea", map_to:"details" },
			{name:"time", height:72, type:"time", map_to:"auto"}
		]
		*/
		scheduler.config.lightbox.sections=[	
			{name:"description", height:200, map_to:"text", type:"textarea" , focus:true},
			{name:"time", height:72, type:"time", map_to:"auto"}
		];


		scheduler.config.first_hour=8;
		scheduler.config.last_hour=18;
		scheduler.config.limit_time_select=true;
		//scheduler.locale.labels.section_location="Location";
		scheduler.config.details_on_create=true;
		scheduler.config.details_on_dblclick=true;
		scheduler.config.edit_on_create=true;
		scheduler.config.multi_day = true;
		scheduler.config.full_day=true;
		

		//scheduler.config.readonly = true;
		//以下代码为设置只读日程
		<#if form?exists && form.getObject("userid")?exists && (form.getInteger("userid")!=Session.user.id)>
		scheduler.config.readonly_form = true;
		scheduler.attachEvent("onBeforeDrag",function(){return false;})
		scheduler.attachEvent("onClick",function(){return false;})
		scheduler.config.dblclick_create = false;
		</#if>
		
		//scheduler.init('scheduler_here',new Date(2009,10,1),"day");//指定初始日期
		scheduler.init('scheduler_here',null,"day");//默认为今天
		//scheduler.setLoadMode("month")
		
		var dataURL = "/data/sc.action";

		<#if form?exists && form.getString("userid")?exists>
		scheduler.load(dataURL+"?scid=dc_events&userid=${form.getString('userid')}");
		var dp = new dataProcessor(dataURL+"?scid=dc_event_editor&userid=${form.getString('userid')}");
		<#else>
		scheduler.load(dataURL+"?scid=dc_events");
		var dp = new dataProcessor(dataURL+"?scid=dc_event_editor");
		</#if>
		
		dp.init(scheduler);

	}
	
	function show_minical(){
		if (scheduler.isCalendarVisible())
			scheduler.destroyCalendar();
		else
			scheduler.renderCalendar({
				position:"dhx_minical_icon",
				date:scheduler._date,
				navigation:true,
				handler:function(date,calendar){
					scheduler.setCurrentView(date);
					scheduler.destroyCalendar()
				}
			});
	}

</script>

<body onload="init();">
	<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
		<div class="dhx_cal_navline">
			<div class="dhx_cal_prev_button">&nbsp;</div>
			<div class="dhx_cal_next_button">&nbsp;</div>
			<div class="dhx_cal_today_button"></div>
			<div class="dhx_cal_date"></div>
			<div class="dhx_minical_icon" id="dhx_minical_icon" onclick="show_minical()">&nbsp;</div>
			<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
			<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
			<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
		</div>
		<div class="dhx_cal_header">
		</div>
		<div class="dhx_cal_data">
		</div>		
	</div>
</body>